home *** CD-ROM | disk | FTP | other *** search
/ Light ROM 1 / LIGHT-ROM 1 (Amiga Library Services)(1994).iso / ffdisks / d978.lha / MouseClock / MClk.doc < prev    next >
Text File  |  1994-04-03  |  15KB  |  396 lines

  1.  
  2.                              MouseClock Project
  3.                                  Rev. 1.22
  4.                                  13-Jan-94
  5.                    Copyright (C) 1993  Adriano De Minicis
  6.  
  7.  
  8.  
  9. WHAT IS IT?
  10. ===========
  11.  
  12. MouseClock is a hardware/software project of a low cost, very small external
  13. battery backed up clock calendar for all Amigas (especially for A1200, A500,
  14. A600).  It is connected to the mouse port #2.
  15.  
  16.  
  17.  
  18. REQUIREMENTS 
  19. ============
  20.  
  21. It works on all Amigas with OS1.2 or greater (tested on A1200, A2000, A500).
  22. Some practice is required to build MouseClock.  If you have never built an
  23. electronic circuit it's better to ask a friend for help.
  24.  
  25.  
  26.  
  27. CONTENTS
  28. ========
  29.  
  30.  1. Description
  31.  2. Shareware notice
  32.  3. Distribution
  33.  4. Disclaimer
  34.  5. Usage of MouseClock (hardware)
  35.  6. Usage of SetMClock (software)
  36.  7. Error messages and suggestions
  37.  8. Hardware description
  38.  9. Construction
  39. 10. Calibration
  40. 11. Thanks
  41.  
  42.  
  43.  
  44. 1. DESCRIPTION
  45. ==============
  46.  
  47. MouseClock, as stated before, is a very small external clock.
  48. The advantages of an external clock are:
  49.  
  50. - Installing it does not void warranty.
  51. - It is compatible with all Amigas: if, for example, you have an A500 and
  52.   you plan to buy an A1200 you can move MouseClock from one computer to
  53.   the other in a few seconds.
  54. - It may be used as an emergency replacement for a damaged internal clock.
  55.  
  56. Someone may suppose that external is cumbersome and/or occupies the
  57. joystick port:
  58.  
  59. - It's very small (the dimensions of my prototype are: 44 x 35 x 16
  60.   millimeters).
  61. - Adding a few parts you can build a "pass trough" joystick version.
  62.   With a switch you select MouseClock or the joystick.
  63.  
  64. How much it costs?
  65.  
  66. - Much less than an internal clock: about 15$
  67.  
  68. This archive contains the documentation (this file) and the software
  69. (SetMClock) to read/write the clock (included source in assembler).
  70. The circuit diagram and the detailed mounting plan will be sent to you on
  71. receipt of the shareware donation (see Distribution).
  72.  
  73.  
  74.  
  75. 2. SHAREWARE NOTICE
  76. ===================
  77.  
  78. MouseClock is SHAREWARE.  If you want to receive the complete circuit
  79. diagram and the mechanical construction plan, send me the shareware fee in
  80. one of the ways listed below.  
  81. Please specify that money is for MouseClock (because I'm working on other
  82. shareware projects).
  83.  
  84. Payment
  85. -------
  86. If you pay with an International Money Order send me 10000 Italian Lire
  87. (LIT).  Make sure I receive Italian Lire (the exchange is done at your post
  88. office).  Specify "MouseClock" as cause.
  89.  
  90. If you pay cash send me (in closed envelope) 10000 LIT or 7 US$ or 12 DM
  91. or 5 GBP. Remember to include your address and the cause "MouseClock".
  92. Cash payment is at your risk. Use two envelopes for safety's sake.
  93.  
  94. DO NOT SEND Cheques, US or Canadian Postal orders, COD, ... , because I
  95. can't cash them. Use only International Money Order or cash. Thank you.
  96.  
  97. My address is:
  98.  
  99.        Adriano De Minicis
  100.        Via Latisana 37
  101.        33054 Lignano Sabbiadoro  UD
  102.        ITALY
  103.  
  104. Why is this project shareware?.  Because I've spent much more time to write
  105. the documentation, diagrams, and rewriting in assembly SetMClock (originally
  106. in GFA Basic: 17KB compiled!) than to design and build the prototype for my
  107. new A1200.  I think that 7$ is quite reasonable.
  108.  
  109. If there will be enough feedback to this project, I'll publish the projects
  110. on which I'm working:
  111.  
  112. - a 4-ways parallel port switch (completely electronic: no mechanical
  113.   switches), controlled by Amiga (also from Arexx), with all pins 
  114.   bidirectional.
  115. - a simplified 8-bit logic analyzer.
  116.  
  117.  
  118.  
  119. 3. DISTRIBUTION
  120. ===============
  121.  
  122. The files in this archive may be copied and distributed freely (also on
  123. networks) as long as all the files remain unmodified and intact, and as
  124. long as there is no charge for them except a reasonable copying and media
  125. fee.
  126.  
  127. The circuit diagram you will receive sending me the shareware donation is
  128. Copyright by Adriano De Minicis and MUST NOT BE DISTRIBUTED (in any form).
  129.  
  130. You are not allowed to sell MouseClock in commercial way (contact me for
  131. agreements).
  132.  
  133.  
  134.  
  135. 4. DISCLAIMER
  136. =============
  137.  
  138. SetMClock sets as outputs some lines of the mouse port #2 (GamePort).
  139. Remove any peripheral from that connector before running SetMClock, to avoid
  140. damages to the peripheral and/or the Amiga.  Note: when SetMClock ends, the
  141. mouse port returns to the standard configuration.
  142.  
  143. It is possible to connect a joystick to an auxiliary connector if you'll
  144. build the pass-through version of MouseClock (only few additional parts
  145. required).
  146.  
  147. WARNING
  148. -------
  149. NEVER insert or remove MouseClock when the Amiga is on, especially if you
  150. haven't removed the metallic shield of the DB9 connector of MouseClock.  
  151. In fact, pin 7 and 8 (+5V, GND) of the mouse port may be shorted by the
  152. metallic shield of the other connector, shorting the Amiga!.  I STRONGLY
  153. SUGGEST to cut the metallic shield from the DB9 female connector of
  154. MouseClock (not Amiga!).  If you'll do this, there is no risk to short the
  155. Amiga, however is always better not to insert/remove MouseClock when the
  156. Amiga is on.
  157.          
  158. I CANNOT BE HELD RESPONSIBLE FOR ANY KIND OF DAMAGE CAUSED BY THIS PROJECT.
  159.                  BUILD AND USE IT AT YOUR OWN RISK..ETC...
  160.  
  161.  
  162.  
  163. 5. USAGE OF MouseClock (hardware)
  164. =================================
  165.  
  166. Using MouseClock is simple: connect it to the mouse port #2 (gameport)
  167. when the Amiga is off (read the warning notes above!).
  168.  
  169. Base version of MouseClock
  170. --------------------------
  171. Simply use SetMClock to access the clock (see below).
  172.  
  173. Joystick version of MouseClock
  174. ------------------------------
  175. This version allows you to connect a joystick (not an analog joystick or
  176. paddle) to the auxiliary DB9 connector.
  177. Set the switch to the 'Clock' position before calling SetMClock (otherwise
  178. SetMClock doesn't see the clock!). No damage occurs if you use a joystick
  179. when the switch is in the 'Clock' position or vice versa.
  180.  
  181.  
  182.  
  183. 6. USAGE OF SetMClock (software)
  184. ================================
  185.  
  186. SetMClock is the software to set the system time from MouseClock or vice
  187. versa.  It's the replacement of SetClock.  Being written 100% in assembler,
  188. it is quite compact (about 3K).
  189.  
  190. SetMClock requires the file "MClock.upd" (4 bytes) in the directory "S:" to
  191. work properly.  This file is created the first time with the option 'save'.
  192. It is necessary because the clock chip I've used doesn't save the year,
  193. which must be saved on disk.  The year is automatically updated comparing
  194. the current date with the date stored in the file (day, month any year of
  195. the last 'save').  If the current date (read from MouseClock) precedes the
  196. date stored in the file, then the year must be increased.  The only
  197. situation that can cheat MouseClock is when the computer remains off from
  198. the beginning of the new year to the month and day stored in the file.  For
  199. example, if "MClock.upd" contains '15 Jan 1993' and MouseClock reads '10
  200. Jan', then year is 1994; but if MouseClock reads '15 Jan' or later the year
  201. is 1993, with the exception above mentioned.  To avoid this situation,
  202. update the clock for example at the end of January, so that SetMClock has an
  203. entire month to notice that the year is changed.
  204.  
  205. If you don't have a hard-disk, it's better to copy the file "S:MClock.upd"
  206. in all the boot disks that make use of SetMClock.
  207.  
  208. WARNING: Do not run SetMClock if a peripheral other than MouseClock is
  209.          connected to the mouse port #2. See the Disclaimer chapter.
  210.  
  211. NOTE: Do not run multiple copies of SetMClock since they interfere, giving
  212.       wrong results (but there is no damage).
  213.  
  214.  
  215. CLI/Shell Usage
  216. ---------------
  217. SetMClock load     Set system time/date from MouseClock. Requires file 
  218.                    "S:MClock.upd".
  219.                    If you want to set system time every time you boot
  220.                    the Amiga, include this command in the startup-sequence
  221.                    (or user-startup).
  222.  
  223. SetMClock save     Store system time/date into MouseClock and into the file
  224.                    "S:MClock.upd" (creating it if it doesn't exist).
  225.                    Use the AmigaDOS command 'date' or the 'Time' prefs
  226.                    (WB 2.0 or higher) to set the system time. Example:
  227.  
  228.                      date 1-jun-93 12:34
  229.                      setmclock save
  230.  
  231.                    Note: when saving, seconds are reset. To reduce the
  232.                    error, wait for seconds being near zero before running
  233.                    SetMClock (or use the 'zero' option to correct seconds).
  234.  
  235. SetMClock zero     Reset seconds of MouseClock. If the seconds counter was
  236.                    at position 30..59, time is advanced by one minute
  237.                    (seconds are always reset).
  238.  
  239. SetMClock          Shows some help.
  240.  
  241.  
  242. WorkBench Usage
  243. ---------------
  244. Use a project icon which default tool is "SetMClock" (with path) and which
  245. tooltypes are:
  246.  
  247. MODE=load  \
  248. MODE=save   } Use ONLY ONE of this (equivalent to CLI option)
  249. MODE=zero  /
  250.  
  251. The default tooltype is 'load'.
  252.  
  253. You can use the three icons I've supplied as examples. Attention: if you
  254. move SetMClock to another directory (for example C:) you must modify the
  255. default tool of those icons, including the complete path to SetMClock.
  256.  
  257. It's useful to start SetMClock from WB if you have booted the Amiga
  258. from a disk that doesn't call SetMClock in the startup-sequence.
  259.  
  260.  
  261.  
  262. 7. ERROR MESSAGES AND SUGGESTIONS
  263. =================================
  264.  
  265. Can't find battery backed up clock
  266. ----------------------------------
  267. MouseClock is not connected to the mouse port #2, or it doesn't work.
  268. If you have the joystick version of MouseClock probably the switch is
  269. not set to the 'clk' position.
  270.  
  271. Battery backed up clock not set
  272. -------------------------------
  273. MouseClock is found, but date and time are not set. This happens every time
  274. the battery power fails, and thus also the first time.
  275. If this error occurs every time you switch off the Amiga, then the battery
  276. may be low or not connected. Check it (battery voltage must be greater than
  277. 2.2V).
  278.  
  279. Can't open S:MClock.upd
  280. -----------------------
  281. File "S:MClock.upd" does not exist or can't be opened.
  282.  
  283. Can't save S:MClock.upd
  284. -----------------------
  285. Probably the system disk is write protected.
  286.  
  287. Bad data in S:MClock.upd
  288. ------------------------
  289. Garbage found in "S:MClock.upd". Restore with SetMClock save.
  290.  
  291.  
  292.  
  293. 8. HARDWARE DESCRIPTION
  294. =======================
  295.  
  296. To reduce the number of I/O lines (so that MouseClock can be connected to
  297. the mouse port instead of the parallel port) I've used a clock chip with the
  298. I²C bus (IC1).  The other chip (IC2) interfaces the Amiga and the I²C bus.
  299. Diodes D1 and D2, connected to the I²C feedback lines, avoid an excessive
  300. current flow from the battery to the Amiga when the Amiga is off.  If the
  301. diodes are shorted, the current drawn from the battery would be much higher
  302. than the current consumption of IC1, descharging the battery too quickly.
  303.  
  304.  
  305.  
  306. 9. CONSTRUCTION
  307. ===============
  308.  
  309. Together with the circuit diagram you'll receive the mechanical mounting
  310. plans on veroboard (2.54mm step, 1/10"). These drawings refer only to the
  311. base version of MouseClock. If you want to build the joystick extension
  312. you have to make the few modifications shown by the circuit diagram.
  313.  
  314. I suggest to use a thin wire-wrap wire (for example AWG 28) to make the
  315. connections. You can transform directly the connection map to a printed
  316. circuit board (because there are no intersections) if you don't want to
  317. use the veroboard.
  318.  
  319. The NiCd battery I've used has a diameter of about 15mm, a height of 7mm;
  320. the compensator has a diameter of 7mm. If you use different sized parts
  321. you may have to make some small modification to the connection layout.
  322.  
  323. I suggest to use sockets for the two ICs, and to cut with a hack-saw the
  324. metallic shield of the DB9 female connector.
  325.  
  326. Start by fitting the sockets, the two pins for the jumper, all resistors and
  327. capacitors, the quartz, and the transistor.  Next fit the DB9 connector,
  328. the diodes and the additional parts for the joystick extension (if used).
  329. Do not mount the battery. Make a first check of all connections, making sure
  330. that there are no short circuits, expecially between the 5V line and ground
  331. (pins 7 and 8 of the DB9 connector). A short circuit between these lines
  332. can damage your Amiga. Be careful!. Don't be in a hurry to test the clock!
  333.  
  334. When you are sure that it's all ok, mount the battery (with the jumper not
  335. inserted).  Make sure not to short the battery (use a insulated cable to
  336. connect the negative pin of the battery, and don't lean the circuit on
  337. metallic objects:  NiCd batteries don't like to be shorted!).  Make a second
  338. check of all connections.  If there are no errors, insert the two integrated
  339. circuits in their sockets, making sure they have the correct orientation and
  340. they are not swapped.
  341.  
  342. Another check, and then insert the jumper (that supplies the circuits).  If
  343. you have built the joystick version set the switch to the 'clock' position.
  344. Switch off the Amiga, connect MouseClock to the mouse port #2, and switch on
  345. the Amiga.  From the WB, double click on the ClkLoad icon: if appears the
  346. requester "Can't find battery backed up clock" you have done some error in
  347. the circuit.  Switch off the Amiga, and check the circuit (may be the switch
  348. is not in the 'clk' position).  If the circuit works properly you should see
  349. the requester "Battery backed up clock not set" or "Can't open
  350. S:MClock.upd".  Try to double click on the ClkSave icon: there shouldn't be
  351. any message.  Retry with ClkLoad: if no message appears it's all O.K.,
  352. congratulations!.  To see how to use SetMClock or for an explanation of the
  353. error messages see the respective sections of this doc.
  354.  
  355. If the circuit doesn't work and you can't find the error, check if there is
  356. a 1Hz square wave between pin 5 of IC1 and ground. If there isn't then
  357. the quartz oscillator doesn't work: try adjusting the compensator.
  358.  
  359. NOTE: The NiCd battery is probably discharged when you build MouseClock.
  360.       To recharge the battery leave the computer on for some hours (the
  361.       charge time is usually 14 hrs, but it isn't necessary to leave the
  362.       Amiga on for all that time, if you often use the Amiga).
  363.       If you have a NiCd battery charger you can recharge the battery
  364.       with it before soldering the battery to the circuit.
  365.  
  366. Have a good work!  :-)
  367.  
  368.  
  369.  
  370. 10. CALIBRATION
  371. ===============
  372.  
  373. The calibration of the circuit can be omitted, since the clock is quite
  374. precise.
  375.  
  376. If you have a frequency meter with good resolution at low frequencies (must
  377. display fractions of Hertz), adjust the compensator until you read exactly
  378. 128 Hz on pin 8 of IC1.
  379.  
  380. If you don't have a frequency meter, the procedure is longer: if you notice
  381. that the clock is too fast or slow after a week, turn the compensator a
  382. little in one direction.  After another week check the error: if it is
  383. decreased, the direction of the rotation is correct, otherwise, turn the
  384. compensator in the opposite direction.  Many adjustments are needed to
  385. reduce the error.
  386.  
  387.  
  388.  
  389. 11. THANKS
  390. ==========
  391.  
  392. I wish to thank Roberto Borri for his suggestions and debugging,
  393. Fred Fish for his great PD-collection, and the Commodore-Amiga for the
  394. new AGA chipset.
  395.  
  396.